﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="List.aspx.cs" Inherits="Cn.Cellula.Website.Admin.Permission.Role.List"
    Title="角色管理" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link type="text/css" rel="Stylesheet" href="/Cellula_Client/Controls/Functions.css" />
    <script type="text/javascript" src="/cellula_client/Controls/UserFunc.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_PageTitle" runat="server">
    角色管理
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_MainBody" runat="server">
    <asp:HiddenField runat="server" ID="hid_SelectedRoleKey" />
    <table width="100%">
        <tr>
            <td valign="top" width="50%">
                <div class="action_bar">
                    <asp:Button ID="btn_RoleAdd" runat="server" Text="增加" OnClick="btn_RoleAdd_Click" />
                    <asp:Button ID="btn_RoleUpdate" runat="server" Text="修改" OnClick="btn_RoleUpdate_Click" 
                        OnClientClick="return acu.gv.checkModify(fixId('gvRoleList'));"  />
                    <asp:Button ID="btn_RoleDel" runat="server" Text="删除" OnClick="btn_RoleDel_Click" 
                        OnClientClick="return acu.gv.checkDelete(fixId('gvRoleList'));" />
                </div>
                <fieldset class="fieldset_2">
                    <legend>角色列表</legend>
                    <asp:GridView ID="gvRoleList" runat="server" AutoGenerateColumns="false" CssClass="GridView"
                        DataKeyNames="RoleKey" onrowcommand="gvRoleList_RowCommand">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <input id="CheckAll" onclick="return acu.gv.selectAll(this,event);" tabindex="0"
                                        type="checkbox" title="点击全选或反全选当前页所有信息" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbxRow" runat="server" CausesValidation="False"></asp:CheckBox>
                                </ItemTemplate>
                                <ItemStyle Width="10px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="名称">
                                <ItemTemplate>
                                    <a href='admin/Permission/Role/Edit.aspx?id=<%# DataBinder.Eval(Container, "DataItem.RoleKey")%>'><%# DataBinder.Eval(Container, "DataItem.RoleName")%></a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="RoleLevel" HeaderText="等级" />
                            <asp:TemplateField HeaderText="管理组">
                                <ItemTemplate>
                                    <div class='sign_yn<%# DataBinder.Eval(Container, "DataItem.IsSysop") %>'></div>
                                </ItemTemplate>
                                <ItemStyle Width="50px" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ID="lbtn_SubList" CommandName="CheckFunc" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.RoleKey") %>'>&gt;&gt;</asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle Width="20px" />
                            </asp:TemplateField>
                        </Columns>
                        <HeaderStyle CssClass="GridViewHeader" />
                        <RowStyle CssClass="GridViewRow" />
                        <FooterStyle CssClass="GirdViewFooter" />
                        <AlternatingRowStyle CssClass="GirdViewAlternatingRow" />
                        <PagerStyle CssClass="GridViewPager" />
                        <EmptyDataRowStyle CssClass="GridViewEmptyDataRow" />
                        <EmptyDataTemplate>
                            没有可用的数据</EmptyDataTemplate>
                    </asp:GridView>
                </fieldset>
            </td>
            <td valign="top" width="50%">
                <div class="action_bar">
                    <asp:Button ID="btn_Bind" runat="server" Text="绑定角色和功能项" onclick="btn_Bind_Click" />
                </div>
                <fieldset class="fieldset_2">
                    <legend>绑定功能(M为菜单项)</legend>
                    <asp:Label runat="server" ID="lab_FuncData"></asp:Label>
                    <script type="text/javascript">
                        var _ufunc = new UserFunc("_ufunc");
                        if(typeof(FuncData)=="object"){
                            _ufunc.display(FuncData,"bind");
                        }
                        if(typeof(RoleFunc)=="object"){
                            _ufunc.bindRole(RoleFunc);
                        }
                    </script>
                </fieldset>
            </td>
        </tr>
    </table>
</asp:Content>
